﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DomainDriver.DomainModeling.DomainObjects
{
    public class ValueObjectEqualityComparer<VALUE_OBJECT> : IEqualityComparer<VALUE_OBJECT>
        where VALUE_OBJECT : IValueObject<VALUE_OBJECT>
    {
        public virtual bool Equals(VALUE_OBJECT x, VALUE_OBJECT y)
        {
            return x.EqualsValues(y);
        }

        public virtual int GetHashCode(VALUE_OBJECT obj)
        {
            return obj.GetHashCode();
        }
    }
}